import {createRouter,  createWebHistory} from "vue-router";
import Homepage from "../views/homepage.vue";
import Login from "../views/login.vue"
import ShowArticle from "../views/showArticle.vue";
import Register from "../views/register.vue";
import User from "../views/userCenter.vue";
import AdminHome from "../admin/homepage.vue"
//引入相关组件
//路由配置
const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            name:'主页',
            //默认路径
            path: '/home',
            //对应的组件
            component:Homepage,
        },
        {
            name:'登录',
            //默认路径
            path: '/login',
            //对应的组件
            component: Login,
        },
        {
            name:'showArticle',
            //默认路径
            path: '/show',
            //对应的组件
            component: ShowArticle,
        },
        {
            name:'注册',
            path:'/register',
            component:Register,
        },
        {
            name:'个人中心',
            path:'/user',
            component:User,
        },
        {
            name:'adminHome',
            path:'/admin/home',
            component:AdminHome,
        }
    ]
})
export default router;